/*
 * 品牌搜索
 * @Author: ljb
 * @Date: 2018-03-27 17:51:07
 * @Last Modified by: ljb
 * @Last Modified time: 2018-08-06 18:09:03
 */
<template>
	<Form
		ref="formInline"
		name="search-form"
		inline
		@keydown.native.enter.prevent="confirmSearch">

		<Form-item
			:label-width="100"
			:label="$t('brand.video_type')"
			porp="video_type_id">
			<Select
				v-model="formValidate.video_type_id"
				name="search-video_type_id"
				clearable
				filterable>
				<Option
					v-for="( value , key ) in videoTypes"
					:value="key + ''"
					:key="key">{{ value }}</Option>
			</Select>
		</Form-item>

		<Form-item
			:label-width="100"
			:label="$t('brand.video_name')"
			prop="title">
			<i-input
				v-model="formValidate.name"
				:placeholder="$t('brand.please_enter_video')"
				name="search-name"
				type="text" />
		</Form-item>

		<Form-item>
			<Button
				type="primary"
				@click="confirmSearch">
				{{ $t('common.search') }}
			</Button>
		</Form-item>

	</Form>
</template>
<script>

export default {

	name: 'AdminBrandSearchForm',

	props: {
		videoTypes: {
			type: Object,
			required: true,
		},
	},

	data() {
		return {
			formValidate: {
				video_type_id: '',

				name: '',
			}, // 搜索框的对象参数
		};
	},

	methods: {

		/**
         * 确认搜索
         * @return {undefined}
         */
		confirmSearch() {
			const param = {
				video_type_id: this.formValidate.video_type_id,

				name: this.formValidate.name,
			};

			this.$emit('search', param);
		},

	},

};

</script>
